﻿using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Tpl.Domain.Entities;

namespace Tpl.Domain.Config
{
    public class UserConfig : EntityTypeConfiguration<User, long>
    {
        public override void Configure(EntityTypeBuilder<User> builder)
        {
            base.Configure(builder);

            builder.Property(x => x.Name).HasMaxLength(50);
            // mock一条数据
            builder.HasData(new User()
            {
                Id = 1,
                Name = "Bruce",
                Birthday = DateTime.Parse("1996-08-24")
            });
        }
    }
}
